package com.iteye.weimingtom.cimmod;

public class TokenInfo {
	public int getBindTime2() {
		if (createTime > 0 && closeTime > 0) {
			return (int)((closeTime - createTime) / 1000.0);
		} else if (createTime > 0 && closeTime == 0) {
			return (int)((System.currentTimeMillis() - createTime) / 1000.0);
		} else {
			return 0;
		}
	}
	
	private String token = "";
	private long createTime = 0;
	private long refreshTime = 0;
	private long closeTime = 0;
	private int alive = 0; //0:dead, 1: alive
	private String username = "";
	
	
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public long getCreateTime() {
		return createTime;
	}
	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}
	public long getRefreshTime() {
		return refreshTime;
	}
	public void setRefreshTime(long refreshTime) {
		this.refreshTime = refreshTime;
	}
	public long getCloseTime() {
		return closeTime;
	}
	public void setCloseTime(long closeTime) {
		this.closeTime = closeTime;
	}
	public int getAlive() {
		return alive;
	}
	public void setAlive(int alive) {
		this.alive = alive;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	
	
}
